package at.ltasat.test.level2;

public final class Point {

	private final int x, y;

	public Point(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int x() {
		return x;
	}

	public int y() {
		return y;
	}

	@Override
	public int hashCode() {
		return x + y;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Point) {
			Point other = (Point) obj;
			return x == other.x && y == other.y;
		}
		return false;
	}
	
	@Override
	public String toString(){
		return String.format("(%d,%d)", x, y);
	}
}
